//
//  NSDate+MJ.h
//  ItcastWeibo
//
//  Created by apple on 14-5-9.
//  Copyright (c) 2014年 itcast. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, YWDateComponentsStyle) {
    YWYearCalendarUnit ,
    YWMonthCalendarUnit ,
    YWDayCalendarUnit ,
    YWWeekdayCalendarUnit ,
    YWHourCalendarUnit ,
    YWMinuteCalendarUnit ,
    YWSecondCalendarUnit ,
    
    //用作ID
    YWDateAndTimeCalendarUnit ,
    //用作headerID
    YWYearAndMonthCalendarUnit
};
@interface NSDate (MJ)
/**
 *  是否为今天
 */
- (BOOL)isToday;
/**
 *  是否为昨天
 */
- (BOOL)isYesterday;
/**
 *  是否为今年
 */
- (BOOL)isThisYear;

/**
 *  返回一个只有年月日的时间
 */
- (NSDate *)dateWithYMD;

/**
 *  获得与当前时间的差距
 */
- (NSDateComponents *)deltaWithNow;

//比较两个时间的大小
+(int)compareOneDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay;



+(NSString*)nowTime;

+(NSDate*)convertDateWithString:(NSString*)timeStr;

- (BOOL)isBetweenFromDate:(NSDate*)fromDate toDate:(NSDate*)toDate;


//获取NSDate的年月日

//获取NSDate星期几
-(NSString*)getDayWeek:(int)dayDelay withComponent:(YWDateComponentsStyle)dateCompoment;//dayDelay代表向后推几天


//获取NSDate星期几
-(NSString*)getDayWithComponent:(YWDateComponentsStyle)dateCompoment;//具体某一天的时间

+ (int)compareOneCalendarDay:(NSDate *)oneDay withAnotherCalendarDay:(NSDate *)anotherDay;

//传入今天的时间，返回明天的时间
+(NSString *)GetTomorrowDay:(NSDate *)aDate;
@end
